package com.example.sys.org.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.core.po.BasePo;
import com.example.sys.attachment.po.ISysAttachment;
import com.example.sys.attachment.po.SysAttachment;
import com.example.sys.log.po.ISysLog;
import com.example.sys.org.enums.SysDegreeEnums;
import com.example.sys.org.enums.SysLevelEnums;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
@ApiModel(value = "用户信息")
@TableName(value = "sys_user")
public class SysUser extends BasePo<SysUser> implements ISysLog , ISysAttachment {

    @ApiModelProperty(value = "用户名")
    @TableField(value = "user_name")
    private String userName;

    @ApiModelProperty(value = "密码")
    @TableField(value = "pass_word")
    private String passWord;

    @ApiModelProperty(value = "手机号")
    @TableField(value = "phone")
    private String phone;

    @ApiModelProperty(value = "邮箱")
    @TableField(value = "email")
    private String email;

    @ApiModelProperty(value = "部门id")
    @TableField(value = "parent_id")
    private String parentId;

    @ApiModelProperty(value = "部门名称")
    @TableField(value = "parent_name")
    private String parentName;

    @ApiModelProperty(value = "层级")
    @TableField(value = "hierarchy")
    private String hierarchy;

    @ApiModelProperty(value = "微信id")
    @TableField(value = "wx_id")
    private String wxId;

    @ApiModelProperty(value = "钉钉id")
    @TableField(value = "ding_id")
    private String dingId;

    @ApiModelProperty(value = "身份证号")
    @TableField(value = "code")
    private String code;

    @ApiModelProperty(value = "最高学历")
    @TableField(value = "level")
    private SysLevelEnums level;

    @ApiModelProperty(value = "最高学位")
    @TableField(value = "degree")
    private SysDegreeEnums degree;

    @ApiModelProperty(value = "所在地id")
    @TableField(value = "address_id")
    private String addressId;

    @ApiModelProperty(value = "所在地名称")
    @TableField(value = "address_name")
    private String addressName;

    @ApiModelProperty(value = "银行卡号")
    @TableField(value = "bank_no")
    private String bankNo;

    @ApiModelProperty(value = "门户内容")
    @TableField(value = "context")
    private String context;

    @ApiModelProperty(value = "年龄")
    @TableField(value = "age")
    private int age;

    @ApiModelProperty(value = "出生日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @TableField(value = "birth_date")
    private Date birthDate;

    @ApiModelProperty(value = "图像")
    @TableField(value = "avatar")
    private String avatar;

    @ApiModelProperty(value = "包含附件")
    private transient List<SysAttachment> fileList = new ArrayList<>();
}
